<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>党建后台</title>
    <meta name="keywords"  />
    <meta name="description"  />
    <link rel="stylesheet" type="text/css" href="/dangjian/Public/layui/css/layui.css" />
    <link rel="stylesheet" type="text/css" href="/dangjian/Public/bootstrap/css/bootstrap.css" />
    <link rel="stylesheet" type="text/css" href="/dangjian/Public/Admin/Css/identify.css" />
    <link rel="stylesheet" type="text/css" href="/dangjian/Public/Admin/Css/layout.css" />
    <link rel="stylesheet" type="text/css" href="/dangjian/Public/Admin/Css/account.css" />
    <link rel="stylesheet" type="text/css" href="/dangjian/Public/Admin/Css/style.css" />
    <link rel="stylesheet" type="text/css" href="/dangjian/Public/Admin/Css/control_index.css" />
    <link rel="stylesheet" type="text/css" href="/dangjian/Public/Admin/Css/index.css" />

    <link rel="stylesheet" type="text/css" href="/dangjian/Public/Admin/Css/page.css" />

    <script type="text/javascript" src="/dangjian/Public/Admin/Js/jquery-1.7.2.min.js"></script>
    <script type="text/javascript" src="/dangjian/Public/layui/layui.js"></script>
    <script type="text/javascript" src="/dangjian/Public/Admin/Js/layer/layer.js"></script>
    <script type="text/javascript" src="/dangjian/Public/Admin/Js/haidao.offcial.general.js"></script>
    <script type="text/javascript" src="/dangjian/Public/Admin/Js/select.js"></script>
    <script type="text/javascript" src="/dangjian/Public/Admin/Js/haidao.validate.js"></script>

    <script type="text/javascript" charset="utf-8" src="/dangjian/Public/ueditor/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="/dangjian/Public/ueditor/ueditor.all.min.js"> </script>
    <!--建议手动加在语言，避免在ie下有时因为加载语言失败导致编辑器加载失败-->
    <!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型，比如你在配置项目里配置的是英文，这里加载的中文，那最后就是中文-->
    <script type="text/javascript" charset="utf-8" src="/dangjian/Public/ueditor/lang/zh-cn/zh-cn.js"></script>
</head>

<body>

    <!--<div class="view-product" style="margin-top: 50px">-->
        <div class="info-center">
            <div class="manage-head">
                <h6 class="padding-left manage-head-con"><?php echo ($title); ?></h6>
            </div>
            <div class="offcial-table input-table table-margin clearfix">

                <div class="demoTable">
                    <a href="<?php echo U('User/addUser');?>" class="layui-btn layui-btn-normal">添加党员</a>

                    <form action="<?php echo U('User/index');?>" method="get" style="margin-top: 20px">
                        姓名：
                        <div class="layui-inline">
                            <input class="layui-input" name="name"  autocomplete="off">
                        </div>
                        职位:
                        <div class="layui-inline">
                            <div class="layui-input-inline">
                                <select name="category" lay-search="" class="form-control">
                                    <option value="">所有</option>
                                    <?php if(is_array($cateList)): foreach($cateList as $key=>$val): ?><option value="<?php echo ($val["id"]); ?>"><?php echo ($val["name"]); ?></option><?php endforeach; endif; ?>
                                </select>
                            </div>
                        </div>
                        小组:
                        <div class="layui-inline">
                            <div class="layui-input-inline">
                                <select name="group" lay-search="" class="form-control">
                                    <option value="">所有</option>
                                    <?php if(is_array($groupList)): foreach($groupList as $key=>$val): ?><option value="<?php echo ($val["id"]); ?>"><?php echo ($val["group_name"]); ?></option><?php endforeach; endif; ?>
                                </select>
                            </div>
                        </div>
                        排序：
                        <div class="layui-inline">
                            <div class="layui-input-inline">
                                <select name="order" lay-search="" class="form-control">
                                    <option value="u.id" selected>ID</option>
                                    <option value="u.group_id">分组</option>
                                </select>
                            </div>
                        </div>
                        <div class="layui-inline">
                            <div class="layui-input-inline">
                                <select name="order1" lay-search="" class="form-control">
                                    <option value="asc" selected>正序</option>
                                    <option value="desc">倒序</option>
                                </select>
                            </div>
                        </div>
                        <input type="submit" value="搜索" class="layui-btn">
                    </form>
                </div>
                <?php if($userList == null): ?><div class="tr non-info show border-bottom-none">
                        <span>没查询到符合条件的记录</span>
                    </div>
                    <?php else: ?>
                    <table class="layui-table text-center">
                        <colgroup>
                            <col width="5%">
                            <col width="15%">
                            <col width="15%">
                            <col width="15%">
                            <col width="25%">
                            <col width="20%">
                        </colgroup>
                        <tr>
                            <th class="text-center">ID</th>
                            <th class="text-center">用户名</th>
                            <th class="text-center">职位</th>
                            <th class="text-center">分组</th>
                            <th class="text-center">级别</th>
                            <th class="text-center">操作</th>
                        </tr>
                        <?php if(is_array($userList)): foreach($userList as $k=>$vo): ?><tr>
                                <td><?php echo ($vo["id"]); ?></td>
                                <td><a href="<?php echo U('User/userDetail',array('id'=>$vo['id']));?>"><?php echo ($vo["name"]); ?></a></td>
                                <td><?php echo ($vo["category_name"]); ?></td>
                                <td><?php echo ($vo["group_name"]); ?></td>
                                <td>
                                    <?php $star = $vo['level']%5; ?>
                                    <?php $jewel = floor($vo['level']/5); ?>

                                    <?php if(($jewel) != "0"): $__FOR_START_24743__=0;$__FOR_END_24743__=$jewel;for($i=$__FOR_START_24743__;$i < $__FOR_END_24743__;$i+=1){ ?><i class="layui-icon" style="color: red;">&#xe735;</i><?php } endif; ?>
                                    <?php if(($star) != "0"): $__FOR_START_14676__=0;$__FOR_END_14676__=$star;for($i=$__FOR_START_14676__;$i < $__FOR_END_14676__;$i+=1){ ?><i class="layui-icon" style="color: red">&#xe658;</i><?php } endif; ?>



                                </td>
                                <td><a href="<?php echo U('User/userDetail',array('id'=>$vo['id']));?>" class="layui-btn layui-btn-sm layui-btn-normal">查看详情</a></td>
                                    <!--<a href="<?php echo U('User/deleteUser',array('id'=>$vo['id']));?>" class="layui-btn layui-btn-sm layui-btn-danger">删除</a></td>-->

                            </tr><?php endforeach; endif; ?>
                        <tr>
                            <td colspan="6"><div class="sabrosus"><?php echo ($page); ?></div></td>
                        </tr>
                    </table><?php endif; ?>

            </div>
        </div>
        <div class="show-page padding-big-right hidden">
            <div class="page">
            </div>
        </div>
    <!--</div>-->
    <script>
        // function prev(){
        //     window.location.href = document.getElementById('iframepage').previousSrc;
        // }
    </script>

<script>
    function iFrameHeight(f) {
        // f.src
        // var iframeWindow = document.getElementById('iframepage').contentWindow;
        // var currentHref = iframeWindow.document.location.href;
        // console.log(currentHref);
        var ifm= document.getElementById("iframepage");
        var subWeb = document.frames ? document.frames["iframepage"].document : ifm.contentDocument;
        if(ifm != null && subWeb != null) {
            ifm.height = subWeb.body.scrollHeight;
            ifm.width = subWeb.body.scrollWidth;
        }
    }

    function prev(){
        window.location.href = document.getElementById('iframepage').previousSrc;
    }
    // window.location.replace($("#iframepage").src());
    // window.location.href = $("#iframepage").src();
    // var ifm= document.getElementById("iframepage");
    // ifm.height=document.documentElement.clientHeight;
    $(".sidebar-title").live('click', function() {
        if ($(this).parent(".sidebar-nav").hasClass("sidebar-nav-fold")) {
            $(this).next().slideDown(200);
            $(this).parent(".sidebar-nav").removeClass("sidebar-nav-fold");
            $(this).parent(".sidebar-nav").siblings(".sidebar-nav").addClass("sidebar-nav-fold");
            $(this).parent(".sidebar-nav").siblings(".sidebar-nav").children(".sidebar-title").next().slideUp(200);
        } else {
            $(this).next().slideUp(200);
            $(this).parent(".sidebar-nav").addClass("sidebar-nav-fold");
        }
    });
</script>
</body>

</html>